<?php
$this->houseme_view->header();
?>
    <!-- masonry page nav-->
    <?php if(isset($page_next_link)){ ?>
    <div id="page-nav"><a id="page-next-link" href="<?php echo $page_next_link; ?>"></a></div>
    <?php } ?>
    <!-- masonry page nav-->

    <!--照片清單-->
    <div id="photoList">
    <ul>      
        <!--
        <?php 
        if($this->uri->segment(1)!='category' && $this->uri->segment(2)!='search'){ ?>
        <li class="BigShow"><a href="/post/detail/436/"><div class="indexTitle_01">主題推薦</div>
        <img src="<?php echo $this->config->item('image_uploader_original','layout').'/11/1400079288.jpg'; ?>" width="420" height="370" />
       
        <div class="photoListInfo_06">Qubefun樂高電源開關蓋板購買專區
        </div></a></li>       
        <?php } ?>
        -->
        <li class="hidden-xs hidden-sm"><div class="uploadShareBtn"><a href="#">上傳我的俬分享</a></div></li>
        <li><div class="helpBtn"><a href="/question" >大神幫幫我</a></div></li>
        <?php if(!empty($neweast_share)){ ?>
            <?php foreach ($neweast_share as $key => $post) {
            ?>
            <li>
                    <?php 
                        $temp = json_decode($post['upload_image']);
                        $image_filename = $temp[0];
                    ?>
                
                <?php if(isset($keyword)){ ?>
                    <a href="/user_share/detail/<?php echo $post['post_id'].'/?q='.urlencode($keyword); ?>">

                <?php }elseif(isset($category_id)){ ?>
                    <a href="/user_share/detail/<?php echo $post['post_id'].'/?c='.$category_id; ?>">                    
                <?php }else{ ?>
                    <a href="/user_share/detail/<?php echo $post['post_id'].'/'; ?>">
                <?php } ?>
                <img src="<?php echo $this->config->item('image_uploader_fe_thumbs','layout').'/'.$post['user_id'].'/'.$image_filename; ?>" width="200" height="150" />
                
                <!--<div class="btn_collect"><span>/user_share/detail/<?php echo $post['post_id'].'/'; ?></span></div>-->
                <div class="photoListInfo_02">
                <?php echo $post['post_excerpt'] ?>
                </div></a>
            </li>
        <?php } }?>
        <?php if(!empty($all_post)){ ?>
            <?php foreach ($all_post as $key => $post) {
            ?>
                <?php if(isset($post['reject_reason'])){ ?> <!--share-->
                <li>
                    <?php 
                        $temp = json_decode($post['upload_image']);
                        $image_filename = $temp[0];
                    ?>
                
                <?php if(isset($keyword)){ ?>
                    <a href="/user_share/detail/<?php echo $post['post_id'].'/?q='.urlencode($keyword); ?>">

                <?php }elseif(isset($category_id)){ ?>
                    <a href="/user_share/detail/<?php echo $post['post_id'].'/?c='.$category_id; ?>">                    
                <?php }else{ ?>
                    <a href="/user_share/detail/<?php echo $post['post_id'].'/'; ?>">
                <?php } ?>
                <img src="<?php echo $this->config->item('image_uploader_fe_thumbs','layout').'/'.$post['user_id'].'/'.$image_filename; ?>" width="200" height="150" />
                <!--
                <div class="btn_memberLike">123,456,789</div>
                
                <div class="btn_sharefb"></div>
                -->
                <!--<div class="btn_collect"><span>/user_share/detail/<?php echo $post['post_id'].'/'; ?></span></div>-->
                <div class="photoListInfo_02">
                <?php echo $post['post_excerpt'] ?>
                </div></a></li>

                <?php }elseif(isset($post['post_id'])) { ?><!--post-->

                <li>
                    <?php 
                        $temp = json_decode($post['upload_image']);
                        $image_filename = $temp[0];
                    ?>
                
                <?php if(isset($keyword)){ ?>
                    <a href="/post/detail/<?php echo $post['post_id'].'/?q='.urlencode($keyword); ?>">

                <?php }elseif(isset($category_id)){ ?>
                    <a href="/post/detail/<?php echo $post['post_id'].'/?c='.$category_id; ?>">                    
                <?php }else{ ?>
                    <a href="/post/detail/<?php echo $post['post_id'].'/'; ?>">
                <?php } ?>
                <img src="<?php echo $this->config->item('image_uploader_thumbs','layout').'/'.$post['user_id'].'/'.$image_filename; ?>" width="200" height="150" />
                <!--
                <div class="btn_memberLike">123,456,789</div>
                
                <div class="btn_sharefb"></div>
                -->
                <!--<div class="btn_collect"><span>/post/detail/<?php echo $post['post_id'].'/'; ?></span></div>-->
                <div class="photoListInfo_01">
                <?php echo $post['post_excerpt'] ?>
                </div></a></li>
                <?php }elseif(isset($post['topic_id'])){ ?>  <!--topic-->

                    <li>
                        <?php if($post['topic_category'] == '案例分享'){ ?>
                            <div class="indexTitle_03">
                        <?php }elseif($post['topic_category'] == '人物訪談'){ ?>
                            <div class="indexTitle_02">
                        <?php }else{ ?>
                            <div class="indexTitle_01">
                        <?php } ?>
                        <?php echo $post['topic_category']; ?></div>
                        <?php
                            $doc = new DOMDocument();
                            @$doc->loadHTML($post['topic_desc']);
                            $first_img = $doc->getElementsByTagName('img')->item(0);
                            $first_img_src = $first_img->attributes->getNamedItem("src")->value;
                        ?>
                        <a href="/topic/detail/<?php echo $post['topic_id'].'/'; ?>">
                        <img src="<?php echo $first_img_src; ?>" width="200" height="150" />
                        <!--<div class="btn_collect"><span>/topic/detail/<?php echo $post['topic_id'].'/'; ?></span></div>-->
                        <div class="photoListInfo_06"><?php echo $post['topic_excerpt']?></div></a>
                    </li>
                <?php } ?>
                
            <?php } ?>
        <?php } ?>
    </ul>
    <?php if(!empty($all_post)){ ?>
        <div id="infscr-loading"><img alt="Loading..." src="/assets/img/ajax-loading.gif" /><div>Loading....</div></div>
    <?php }else{ echo $this->lang->line('can_not_find_post'); } ?>
    <div class="endSpan"></div>
    </div>
<?php
$this->houseme_view->footer();
?>